<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :md="6" :sm="8">
            <a-form-item label="机构">
              <j-select-depart v-model="queryParam.office"/>
            </a-form-item>
          </a-col>
<!--          <a-col :md="6" :sm="8">-->
<!--            <a-form-item label="系统名称" :labelCol="{span: 5}" :wrapperCol="{span: 18, offset: 1}">-->
<!--              <a-input placeholder="请输入系统名称查询" v-model="queryParam.systemName"></a-input>-->
<!--            </a-form-item>-->
<!--          </a-col>-->
          <a-col :md="6" :sm="8">
           <a-form-item
            label="开通时间">
             <a-select v-model="queryParam.years" @change="dateChange(queryParam.years)">
               <a-select-option v-for="item in year"
                                :label="item.label"
                                :value="item.value">{{item.label}}
               </a-select-option>
             </a-select>
        </a-form-item>
          </a-col>
        </a-row>
        <a-row :gutter="24">
          <a-col :md="12" :sm="8">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
<!--              <a-button type="primary" icon="download" @click="handleExportXls('云资源审核清单')" style="margin-left: 8px">审核清单</a-button>-->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- table区域-begin -->
    <div>
      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
      </div>

      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
        @change="handleTableChange">

        <span slot="action" slot-scope="text, record">
          <a @click="handleDetail(record)">详情</a>
        </span>
      </a-table>
    </div>

    <settlement-fee-model ref="modalForm" @ok="modalFormOk"></settlement-fee-model>
<!--    <settlement-pay-fee-model ref="modalForm" @ok="modalFormOk"></settlement-pay-fee-model>-->
  </a-card>
</template>

<script>

  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
  import settlementFeeModel from './modules/settlementFeeModel'
  // import settlementPayFeeModel from './modules/settlementPayFeeModel'
  import JDate from '@/components/jeecg/JDate.vue'
  import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
  export default {
    name: "cloudServiceMoneyList",
    mixins:[JeecgListMixin],
    components: {
      JDate,
      settlementFeeModel,
      // settlementPayFeeModel,
      JSelectDepart
    },
    data () {
      return {
        year:[],
        queryParam:{
          systemName:'',
          office:'',
          years:''
        },
        description: '',
        // 表头
        columns: [
          {
            title: '序号',
            align: "center",
            dataIndex: '',
            key: 'rowIndex',
            width: 60,
            customRender: function (t, r, index) {
              return parseInt(index) + 1;
            }
          },
          {
            title:'区县',
            align:"center",
            dataIndex: 'sysOrgCodeName',

          },
          {
            title:'结算年份',
            align:"center",
            dataIndex: 'year'
          },
          {
            title:'结算日期',
            align:"center",
            dataIndex: 'payDate'
          },
          {
            title:'应付云服务费',
             align:"center",
            dataIndex: 'yearsMoney'
          },
          {
            title:'优惠减免云服务费',
            align:"center",
            dataIndex: 'yearsSaveMoney',
          },
          {
            title:'实际支付云服务费',
              align:"center",
            dataIndex: 'yearsPayMoney',
          },
            {
              title: '操作',
              dataIndex: 'action',
              align:"center",
              scopedSlots: { customRender: 'action' },
            }
        ],
        url: {
          list: "/jinanCloud/cloudServiceProject/cloudMoneyHistory",

          // list: "/jinanCloud/cloudServiceProject/cloudPayMoneyHistoryList",
          // exportXlsUrl: "/jinanAudit/auditMain/exportXls",
        },
        dictOptions:{
         office:[],
         tos:[],
        } 
      }
    },
    computed: {
    },
    mounted() {
      this.init();
    },
    methods: {
      init(){
        this.getYear();
      },
      dateChange(obj){
        console.log(obj);
      },
      getYear(){//获取年
        let date = new Date();
        let current_year = date.getFullYear();
        // this.queryParam.yearDate=current_year;
        this.year=[];
        for (let i = 0; i < 30; i++) {
          let y = current_year - i;
          this.year.push({value:(y),label:(y)+ "年"});
          // this.yearDate.push(y);
          if(y=='1970'){
            return
          }
        }
      },
      getParams() {
        // 取到路由带过来的参数
        // let sbbm = this.$route.query.sbbm;
        // let lxmc = this.$route.query.lxmc;
        // let cpmc = this.$route.query.cpmc;
        // this.queryParam.bm = sbbm;
        // this.queryParam.lxmc = lxmc;
        // this.queryParam.cpmc = cpmc;
        // 将数据放在当前组件的数据内
        // this.keyupMallName()
      },
      // watch: {
      //   '$route': 'getParams'
      // },

    }
  }
</script>
<style scoped>
  @import '~@assets/less/common.less'
</style>